<?php

namespace src\controller;

use PDO;
use src\common\Db;
use src\common\Request;

class IndexController extends BaseController
{
    public function index()
    {
        include_once(ROOT_DIR . 'dist/index.html');
        die;
    }

    public function submit()
    {
        $p = Request::params();
        return $p;
    }

    public function sysInfo()
    {
        echo PHP_VERSION, PHP_EOL;

        foreach (get_loaded_extensions() as $e) {
            echo $e, PHP_EOL;
        }


        die;
    }

    public function findFromDb()
    {
        $arr = Db::db('db1')->rawQuery("select * from c_caidan")->fetchAll(PDO::FETCH_ASSOC);
        return $arr;
    }
}